<template>
  <van-list>
    <van-cell v-for="city in filteredCities" :key="city.cityId" :title="city.name" @click="onClick(city)" />
  </van-list>
</template>


<script setup>
import { useStore } from '@/stores/index.js'
import { useRouter } from 'vue-router'
const store = useStore()
const router = useRouter()



defineProps({
  filteredCities: {
    type: Array,

  }

});


const onClick = (city) => {
  store.setCityId(city.cityId)
  store.setCityName(city.name)
  store.setPageNum(1)
  store.setTabIndex(0)
  // console.log("当前选择的城市", store.cityId, store.cityName)
  router.push({ path: '/' })
};




</script>
